import request from '@/utils/request'

// 获取分类列表
export function getCategoryList() {
  return request({
    url:'/category/list/tree',
    method:'get'
  })

}

// 添加分类
export function addCategory(article) {
  return request({
    url:'/category',
    method:'post',
    data: article
  })
}

// 删除分类
export function deleteCategory(categoryId) {
  return request({
    url:'/category/' + categoryId,
    method:'delete'
  })
}


// 修改分类
export function updateCategory(categoryId,category) {
  return request({
    url:'/category/' + categoryId,
    method:'put',
    data: category
  })
}


